<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/WarehouseDaily/warehouseDaily"
          method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="warehouseDaily"/>
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel"/>
            <label>时间<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="startTime" value="${startTime}" data-rule="required" data-pattern="yyyy-MM"
                   data-toggle="datepicker" size="12" placeholder="月份">
            %{--<input type="text" name="endTime" value="${endTime}" data-rule="required" data-pattern="yyyy-MM-dd"
                   data-toggle="datepicker" size="12" placeholder="结束日期">&nbsp;--}%
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue"
                    onclick="javascript:bjuiExportExl('#pagerForm', '${request.getContextPath()}/BadProcessAnalysis /exportExcel')"
                    data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="bjui-pageContent">
    <g:if test="${warehouseDaily.size() > 1}">
        <div id="warehouseDaily" style="width:100%;height:600px;margin: auto"></div>
        <script src="${request.getContextPath()}/js/echarts/echarts.js"></script>
        <script src="${request.getContextPath()}/js/echarts/echarts-tool.js"></script>
        <script type="text/javascript">
            var contextPath = "${request.getContextPath()}";
            eChartsTool.init(contextPath);
            var option = {
                toolbox: {
                    show: true,
                    feature: {
                        saveAsImage: {
                            show: true,
                            excludeComponents: ['toolbox'],
                            pixelRatio: 2
                        }
                    }
                },
                title: {},
                tooltip: {
                    trigger: 'aaa'
                },
                legend: {
                    data: ['木工', '铁工', '金刚石', '铝合金']
                },
                xAxis: {
                    data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15'
                        , '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
                },
                yAxis: [
                    {
                        type: 'value',
                        name: '数量'
                    }
                ],
                series: [
                    {
                        name: '木工',
                        type: 'line',
                        data:${listMg}
                    },
                    {
                        name: '铁工',
                        type: 'line',
                        data:${listTg}
                    },
                    {
                        name: '金刚石',
                        type: 'line',
                        data:${listJgs}
                    },
                    {
                        name: '铝合金',
                        type: 'line',
                        data:${listLhj}
                    }
                ]
            };
            eChartsTool.setOption("roma", document.getElementById('warehouseDaily'), option);
        </script>
    </g:if>
    <div style="margin:15px auto; width:96%;">
        <div class="row" style="padding: 0px 0px;">
            <div class="col-md-12">
                <g:if test="${warehouseDaily.size() > 1}">
                    <table id="lapEndByBatch" data-toggle="tablefixed" data-width="100%" data-nowrap="true">
                        <thead>
                        <tr id="t1">
                            <g:each in="${tableHeadList}" status="j" var="headInstance">
                                <g:if test="${headInstance != 'RN' && headInstance != 'CLASSIFY'}">
                                    <th width="50"><g:message code="${headInstance}" default="${headInstance}"/></th>
                                </g:if>
                            </g:each>
                        </tr>
                        </thead>
                        <tbody>
                        <g:if test="${warehouseDaily.size() > 0}">
                            <g:each in="${warehouseDaily}" status="i" var="dataInstance">
                                <tr>
                                    <g:each in="${tableHeadList}" status="j" var="headInstance">
                                        <g:if test="${headInstance == 'MAIN_QTY'}">
                                            <td name="progressNormal${i + 1}">
                                                ${dataInstance["${headInstance}"]}
                                            </td>
                                        </g:if>
                                        <g:elseif test="${headInstance != 'RN' && headInstance != 'CLASSIFY'}">
                                            <td>${dataInstance["${headInstance}"]}</td>
                                        </g:elseif>
                                    </g:each>
                                </tr>
                            </g:each>
                        </g:if>
                        </tbody>
                    </table>
                </g:if>
                <g:else>
                    <g:render template="../template/emptyPanel"/>
                </g:else>
            </div>
        </div>
    </div>
</div>
